<html>

  <head>
    <script>
      window.addEventListener("beforeunload", function (event) {
        event.preventDefault();
      });
    </script>
  </head>

  <body>
    <input type="text" />
    <a href="default.html" target="_top">Click</a>
  </body>

</html>
